package com.zygh.lz.service;

import com.zygh.lz.entity.Sign;
import com.zygh.lz.entity.signfile.SignStatistics;
import com.zygh.lz.vo.ExcelDto;
import com.zygh.lz.vo.ResultBean;
import com.zygh.lz.vo.ResultBeans;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface SignService {
    //签到接口
    ResultBeans signqd(Sign sign) throws ParseException;

    //签退接口
    ResultBeans sifnqt(Sign sign);
    //删除签到信息

    //根据大队查询在线人信息
    List<HashMap> findOnlineUser(String battalion);

    //当前民警已经签到 未签退的岗位
    ResultBeans findPostStatus(String warningSignal, String comment) throws ParseException;

    //2022-05-30 返回格式改掉（yjt）
    ResultBeans findPostStatu(String warningSignal);

    ResultBeans SignInState(String warningsignal);

    int onlineYesterday(String battalion);

    List<HashMap> yesterdayData(String battalion);

    void recvMessage(String message);

    List<Sign> findSignList(String warningsignal, String starttime, String endtime, String sectionId);


    ResultBeans personSign(String img);

    /**
     * 个人签到详情
     *
     * @param staffId 警员id
     * @return ResultBean
     */
    ResultBean personSignDetail(Integer staffId, String startDate, String endDate);

    /**
     * 个人签到详情按月查询
     *
     * @param staffId 警员id
     * @param date    日期
     * @return ResultBean
     */
    ResultBean personSignDetailByMonth(Integer staffId, String date);

    /**
     * 个人签到月报
     *
     * @param staffId   警号
     * @param startDate 月初
     * @param endDate   月末
     * @return ResultBean
     */
    ResultBean personMonth(Integer staffId, String startDate, String endDate);

    ResultBeans detialMonth(Integer staffId, String date);

    ResultBean signDetail(Integer staffId, String date, Integer current, Integer size);


    /**
     * =============================================新增接口=================================================================================
     */

    /**
     * 查询在线人员
     *
     * @return
     */
    List<Sign> findOnLinker(String battalion, String station);


    /**
     * ===========================================================
     * 当班在线警力
     * @return
     */
    /**
     * @param station 日常时传岗位（铁骑，高峰岗，固定岗。。。。）  特殊时传类型id0 1  2 3
     * @param comment 1：日常勤务    2：特殊勤务
     * @return
     */
    List<Map<String, Object>> onDutyOnLine(String onLine);

    List<Map> yesterdayOnLine(String battalion);


    List<Map> yesterdaySignStation(String staffid, String shiftop);


    /**
     * 签到数=正常签到数（高峰岗大于30分钟，其他大于1小时，包含迟到早退的签到；只要达到时长都算签到数）
     * ======================================签到统计====================================================
     */

    /**
     * 按照岗位、时间、班次统计
     *
     * @param sectionId 大队id
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @param shiftop   班次
     * @return List<Map>
     */
    Map signInStatistics(Integer sectionId, String startTime, String endTime, Integer modeCode);

    /**
     * =====================================签到统计接口=======================================
     */
    //支队层面按照班次签到数统计
    List<Map> signInDetail(Integer sectionId, String startTime, String endTime, Integer shiftop);

    //支队层面按照岗位签到数统计
    List<Map> SignDetailByStation(Integer sectionId, String startTime, String endTime);

    //支队层面按照班次签到统计详情
    List<Map<String, Object>> SignInStatistics(Integer sectionId, String startTime, String endTime, Integer shiftop);

    //支队层面按照岗位签到统计详情
    List<Map<String, Object>> SignInStationByDetail(Integer sectionId, String startTime, String endTime, String station);

    //大队层面按照班次签到数统计
    List<Map> signInDetailByLochus(Integer sectionDId, String startTime, String endTime, Integer shiftop);

    //大队层面按照岗位签到数统计
    List<Map> SignDetailByStationLochus(Integer sectionId, String startTime, String endTime, String station);

    //大队层面按照班次签到统计详情
    List<Map<String, Object>> signInByLochus(Integer sectionDId, Integer sectionId, String startTime, String endTime, Integer shiftop);

    //大队层面按照岗位签到统计详情
    List<Map<String, Object>> SignByStationLochus(Integer sectionDId, Integer sectionId, String startTime, String endTime, String station);

    String SignInExport(HttpServletResponse response, Integer sectionId, String startTime, String endTime, Integer shiftop) throws IOException, ParseException;


    //支队层面签到统计导出 按周、月统计导出
    String StatisticsExportByWeek(HttpServletResponse response, Integer sectionId, String startTime, String endTime) throws IOException, ParseException;


    //支队层面签到统计导出 按日统计导出
    String StatisticsExport(HttpServletResponse response, Integer sectionId, String startTime, String endTime) throws IOException, ParseException;

    //支队层面签到统计导出
    String SignInExports(HttpServletResponse response, Integer sectionId, String startTime, String endTime, Integer shiftop) throws IOException, ParseException;

    //大队层面签到统计导出
    String SignInExportLochus(HttpServletResponse response, Integer sectionDId, Integer sectionId, String startTime, String endTime, String station) throws IOException, ParseException;

    void Statistics(String startDay, String endDay);

    void General(String startTime, String endTime);

    /**
     * =====================================end签到统计接口=======================================
     */


    //总数据展示
    Map signInNum(Integer sectionId, String time, HttpServletRequest request);

    //签到天数排名
    List<Map<String, Object>> signInNumBySection(Integer sectionId, String time, Integer depthNumber);

    //签到天数排名，大队下中队排名
    List<Map<String, Object>> signInNumByLochus(Integer sectionId, String time, Integer depthNumber);


    //巡查里程大队排名
    List<Map<String, Object>> distanceRanking(Integer sectionId, String time, Integer depthNumber);

    //巡查里程中队排名
    List<Map<String, Object>> distanceRankingLochus(Integer sectionId, String time, Integer depthNumber);


    //大队签到数和在线数折线图展示 统计这周的在线数和上周的签到数
    List<Map> SignInComparison(Integer sectionId) throws ParseException;

    //中队签到数和在线数折线图展示 统计这周的在线数和上周的签到数
    List<Map> SignInComparisonLochus(Integer sectionId) throws ParseException;

    //巡查里程折线图对比,大队
    List<Map> mileageBrokenLine(Integer sectionId) throws ParseException;

    //巡查里程折线图对比,中队
    List<Map> mileageBrokenLineLochus(Integer sectionId) throws ParseException;


    //统计大队人数巡查里程排名
    List<Map<String, Object>> findMileageBySection(Integer sectionId, String time, String staffname);

    //统计大队人数巡查里程排名
    List<Map<String, Object>> findMileageByLochus(Integer sectionId, String time, String staffname);


    List<Map> findTrackByStaffId(Integer staffId, String time);


    /**
     * ========================================领导驾驶舱=============================================
     */

    //在线人数按大队、民警辅警统计
    List<Map> onlineNumber(Integer id);

    List<Map> totalMileage(Integer id);

    /**
     * 支队层面统计导出
     *
     * @param response  响应数据
     * @param sectionId 大队id
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @throws IOException io异常
     */
    void generalSection(HttpServletResponse response, Integer sectionId, String startTime, String endTime) throws IOException;

    void exportCount(HttpServletResponse response);

    void exportPostCount(HttpServletResponse response);
    /**
     * 导出里程，执法量，时长前100
     *
     * @param response
     */
    void exportTop(HttpServletResponse response, ExcelDto excelDto);

    /**
     * 里程前100
     *
     * @param today 今天
     * @return List<SignStatistics>
     */
    List<SignStatistics> mileages(ExcelDto excelDto, Integer depthNumber);

    /**
     * 时长前100
     *
     * @param today 今天
     * @return List<SignStatistics>
     */
    List<SignStatistics> duration(ExcelDto excelDto, Integer depthNumber);

    /**
     * 执法量前100
     *
     * @param today 今天
     * @return List<SignStatistics>
     */
    List<SignStatistics> jiechuNum(ExcelDto excelDto, Integer depthNumber);


    ResultBean order(HttpServletRequest request);

    ResultBean special();

    ResultBean empty(HttpServletRequest request);

    List<Map> signInDetail2(HttpServletRequest request, Integer sectionId, String startTime, String endTime, Integer shiftop);

    void dailyService(HttpServletResponse response);

    ResultBean getPushSingData();

    List<Integer> getTodaySignInPostId(Integer type);


}

